package com.tyylab.kestrel.framework.example.web.provider;

import cn.hutool.json.JSONObject;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ping")
public class PingController {

    @RequestMapping("")
    public Object ping() {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("msg", "pong");
        return jsonObject;
    }

    @PostMapping("ping2")
    public Object ping2(@RequestBody JSONObject jsonObject) {
        //JSONObject jsonObject = new JSONObject();
        jsonObject.put("msg", "pong");
        return jsonObject;
    }
}
